#ifndef __PALYER_STALL_H__
#define __PALYER_STALL_H__

class PacketDecoder;
class PlayerFaction;
class PlayerStall:public PlayerFaction
{
public:
	PlayerStall(PlayerId stPlayerId);
	virtual ~PlayerStall();

	UInt32			m_nTimerSendStalls;
	virtual void PrepareSendStalls(){if(m_nTimerSendStalls == 0) m_nTimerSendStalls = CreateTimer(boost::bind(&PlayerStall::OnTimerSendStalls, this,_1),100);}
	void OnTimerSendStalls(UInt32 nTimerId);


	void stallTakeOn(Int32 nSrcPage,Int32 nSrcIndex,Int32 nSellCount,Int32 nSellPrice);
	void stallTakeOff(Int32 nIndex);
	StallItemInfo* getStallItemInfoByIndex(Int32 nIndex);
	bool removeStallItem(Int32 nIndex,Int32 nCount);

	void decodeStall();
	void encodeStall();
	void sendStall();
	void sendStallToPlayer(PlayerId& stPlayerId);

protected:
	std::vector<StallItemInfo> m_arStallItems;
};
#pragma pack()
#endif